﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：周司徒
    //
    // 修改标识：
    // 修改描述：
    //
    // 修改标识：
    // 修改描述：
    //
    // 审核人：
    // 审核时间：
    // 审核说明：
 //----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using HZ.DrugTrade.Model;

namespace HZ.DrugTrade.IBLL
{

    public interface IBLL_Interface
    {
        #region 医疗机构端接口

        /// <summary>
        /// 增加一个对应接口
        /// </summary>
        /// <param name="HospitalInterfaceCorrelatio">接口信息</param>
        /// <returns>1成功 0失败()</returns>
        int AddHospitalInterfaceCorrelation(HospitalInterfaceCorrelatio HospitalInterfaceCorrelation);
        /// <summary>
        /// 删除一个已对应接口
        /// </summary>
        /// <param name="HospitalInterfaceCorrelatio">接口信息</param>
        /// <returns>1成功 0失败()</returns>
        int DeleteHospitalInterfaceCorrelation(HospitalInterfaceCorrelatio HospitalInterfaceCorrelation);

        /// <summary>
        /// 搜索服务器采购目录查询字段只限于通用名剂型规格包装生产企业
        /// </summary>
        /// <param name="HospitalProcureCatalog"></param>
        /// <param name="CurrentPage"></param>
        /// <param name="PageSize"></param>
        /// <param name="TotalRecord"></param>
        /// <param name="similarfactor">匹配相似度(推荐0.7)：0不管是否匹配全部取出，1 精确匹配</param>
        /// <param name="IntelligenceSearch">是否采用智能搜索</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.View.HospitalProcureCatalog> QueryServerProcureCatalog(HZ.DrugTrade.Model.Query.HospitalProcureCatalog HospitalProcureCatalog, int CurrentPage, int PageSize, out int TotalRecord, double similarfactor, bool IntelligenceSearch);

        /// <summary>
        /// 获取已对应接口
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="CurrentPage">当前页</param>
        /// <param name="PageSize">页面大小</param>
        /// <param name="RecordCount">记录总数</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.View.HospitalInterface> GetMatchedHospitalInterface(HZ.DrugTrade.Model.Query.HospitalInterface where, int CurrentPage, int PageSize, out int RecordCount);


        /// <summary>
        /// 获取未对应接口
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="CurrentPage">当前页</param>
        /// <param name="PageSize">页面大小</param>
        /// <param name="RecordCount">记录总数</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.View.HospitalProcureCatalog> GetUnMatchedHospitalInterface(HZ.DrugTrade.Model.Query.HospitalProcureCatalog where, int CurrentPage, int PageSize, out int RecordCount);

        /// <summary>
        /// 对应采购单
        /// </summary>
        /// <param name="purchase">客户端导入采购单</param>
        /// <param name="AccountID">客户端帐号</param>
        /// <param name="UnMatchedPurchase">未对应采购单</param>
        /// <returns>对应好的采购单</returns>
        IList<HZ.DrugTrade.Model.View.ImportedPurchaseOrderDetail> MatchPurchaseMemu(IList<HZ.DrugTrade.Model.ImportPurchaseOrderDetail> purchase, string AccountID, out IList<HZ.DrugTrade.Model.ImportPurchaseOrderDetail> UnMatchedPurchase);

        /// <summary>
        /// 自动对应接口数据
        /// </summary>
        /// <param name="CorrelationList">客户端待对应数据列表</param>
        /// <param name="UnCorrelationList">未对应数据列表</param>
        /// <remarks>CorrelationList必须把当前医疗机构ID写入</remarks>
        /// <returns>1成功 0失败</returns>
        int AutoCorresponding(IList<HospitalInterfaceCorrelatio> CorrelationList, out IList<HospitalInterfaceCorrelatio> UnCorrelationList);

        /// <summary>
        /// 获取医疗机构已入库信息
        /// (有医疗机构编码)
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currenpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<Model.View.HopitalInflow_Export> GetHopitalInflow_Export(Model.Query.HopitalInflow_Export where, int currenpage, int pagesize, out int totalrecord);






        #endregion

        #region 企业端接口
        /// <summary>
        /// 增加一个企业对应接口
        /// </summary>
        /// <param name="CompanyInterfaceCorrelation">企业接口参数</param>
        /// <returns></returns>
        int AddCompanyInterfaceCorrelation(CompanyInterfaceCorrelation CompanyInterfaceCorrelation);
        /// <summary>
        /// 删除一个企业对应接口
        /// </summary>
        /// <param name="CompanyInterfaceCorrelation"></param>
        /// <returns></returns>
        int DeleteCompanyInterfaceCorrelation(CompanyInterfaceCorrelation CompanyInterfaceCorrelation);

        /// <summary>
        /// 获取企业采购目录
        /// </summary>
        /// <param name="where"></param>
        /// <param name="CurrentPage"></param>
        /// <param name="PageSize"></param>
        /// <param name="TotalRecord"></param>
        /// <returns></returns>
        IList<Model.View.CompanyProcureCatalog> GetCompanyProcureCatalog(Model.Query.CompanyProcureCatalog where, int CurrentPage, int PageSize, out int TotalRecord);


        /// <summary>
        /// 获取未对应过的企业采购目录
        /// </summary>
        /// <param name="where"></param>
        /// <param name="CurrentPage"></param>
        /// <param name="PageSize"></param>
        /// <param name="TotalRecord"></param>
        /// <returns></returns>
        IList<Model.View.CompanyProcureCatalog> GetUnMatchedCompanyProcureCatalog(Model.Query.CompanyProcureCatalog where, int CurrentPage, int PageSize, out int TotalRecord);


        /// <summary>
        /// 搜索服务器采购目录查询字段只限于通用名剂型规格包装生产企业
        /// </summary>
        /// <param name="HospitalProcureCatalog"></param>
        /// <param name="CurrentPage"></param>
        /// <param name="PageSize"></param>
        /// <param name="TotalRecord"></param>
        /// <param name="similarfactor">匹配相似度(推荐0.7)：0不管是否匹配全部取出，1 精确匹配</param>
        /// <param name="IntelligenceSearch">是否采用智能搜索</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.View.ProcureCatalog> QueryServerProcureCatalog(HZ.DrugTrade.Model.Query.ProcureCatalog HospitalProcureCatalog, int CurrentPage, int PageSize, out int TotalRecord, double similarfactor, bool IntelligenceSearch);


        /// <summary>
        /// 获取已对应接口
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="CurrentPage">当前页</param>
        /// <param name="PageSize">页面大小</param>
        /// <param name="RecordCount">记录总数</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.View.CompanyInterface> GetMatchedCompanyInterface(HZ.DrugTrade.Model.Query.CompanyInterface where, int CurrentPage, int PageSize, out int RecordCount);





        /// <summary>
        /// 企业自动对应接口数据
        /// </summary>
        /// <param name="CorrelationList">客户端待对应数据列表</param>
        /// <param name="UnCorrelationList">未对应数据列表</param>
        /// <remarks>CorrelationList必须把当前企业ID写入</remarks>
        /// <returns>1成功 0失败</returns>
        int AutoCorresponding_Company(IList<CompanyInterfaceCorrelation> CorrelationList, out IList<CompanyInterfaceCorrelation> UnCorrelationList);

        /// <summary>
        /// 生成ERP系统采购单(已对应好的数据)
        /// 
        /// 
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">页面大小</param>
        /// <param name="totalrecord">记录总数</param>
        /// <returns></returns>
        IList<Model.View.CompanyExportPuchaseOrderDetail> GetCorrespondingPurchaseOrderDetail_Company(HZ.DrugTrade.Model.Query.CompanyExportPuchaseOrderDetail where, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 导入ERP系统配送单
        /// </summary>
        /// <param name="erplist">配送单详细</param>
        /// <param name="PurchaseOrder">对应的配送的采购单</param>
        /// <returns>1成功 0 失败</returns>
        IList<Model.Interface.ERPDistribution> ImportDistribution(IList<HZ.DrugTrade.Model.Interface.ERPDistribution> erplist, HZ.DrugTrade.Model.PurchaseOrder PurchaseOrder, string companyID, out IList<Model.Interface.ERPDistribution> UnMatchedERPDistribution);

        #endregion
    }
}